import { Component } from 'react';
import { connect } from 'react-redux';
import * as api from '../../api/employees';
import { 
    Table,
} from 'antd';
import * as TYPES from '../../constants/action-types';

@connect((state) => ({
    employeeList: state.employeeList,
}))
class Employees extends Component {

    componentDidMount () {
        // 把生成的函数给到this.props.dispatch
        this.props.dispatch( api.getEmployeeList({}, TYPES.UPDATE_EMPLOYEE_LIST) );

        setTimeout(() => {
            console.log(this.props.employeeList)
        }, 2000);
    }

    render () {
        return (
            <div>员工</div>
        );
    }

}

export default Employees;
